Function to toggle the rice fields layer on an existing leaflet map, and to select which attributes to use to define the symbology of the fields.

ff_layer_fields(
  m,
  show = TRUE,
  measure = "return",
  selected_return = NULL,
  selected_group = NULL,
  selected_object = NULL
)

Arguments

m

An initialized leaflet map object or leafletProxy object.

show

A boolean value indicating whether the function call will be adding the layer to the map (TRUE) or removing the layer from the map (FALSE). Designed to be changed via shiny checkbox input by calling the function inside an observer.

measure

A string indicating the measure to show. Choose from return to color by return type, or distances to color by distances. FUTURE EDITS: ADD OPTIONS TO COLOR BY VOLUME, INVERTEBRATE MASS PRODUCTION, WET/DRY, ETC.

selected_return

The return_id of a return point to filter to, if desired.

selected_group

The group_id of a watershed to filter to, if desired.

selected_object

The object_id of a single field to filter to, if desired. Used internally.

Examples

# show the layer on a leaflet map object ("m")
m <- ff_make_leaflet()
m |> ff_layer_fields(show = TRUE)